<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>接受</title>
    <@header/>
</head>
<body>

<table id="demo" lay-filter="test" lay-data="{id: 'idTest'}"></table>

<script>
    layui.use('table', function () {
        var table = layui.table;
        //第一个实例
        table.render({
            elem: '#demo'
            , height: 315
            , url: '<@path/>list' //数据接口
            , cols: [[ //表头
                {field: 'id', title: 'ID', width: 80, sort: true, fixed: 'left'}
                , {field: 'title', title: '标题', width: 80}
                , {field: 'origin', title: '来源', width: 80, sort: true}
                , {field: 'time', title: '时间', width: 80}
                , {field: 'content', title: '内容', width: 177}
            ]]
        });

    });
    setInterval("refresh()", 1000);

    function refresh() {
        var table = layui.table;
        table.reload('demo', {
            url: '<@path/>list'
            , where: {} //设定异步数据接口的额外参数
            //,height: 300
        });
    }
</script>
</body>
</html>